const mongoose = require('mongoose');
mongoose.connect('mongodb://172.16.9.218/xianyu');
const db = mongoose.connection;
db.on('error', () => {
  console.error('连接错误！')
});
db.once('open', () => {
  console.log('数据库已连接!');
});
module.exports = mongoose;